import { ReqPage } from "./index";

export namespace System {
  export interface ReqSave {
    value: string;
    remark: string;
  }
}

// 存放位置
export namespace Location {
  // 树查询返回
  export interface ResTreeProps {
    key: string;
    value: TreeProp[];
  }

  // 树内字段
  export interface TreeProp {
    area: string;
    dotime: string;
    douser: string;
    id: number;
    location: string;
    locationInfo: string;
    remark: string;
    status: number;
    uptime: string;
  }
}

export namespace Dictionary {
  export interface Types {
    containerType: "注水吨桶" | "卡板" | "吨桶" | "吨包" | "非标容器" | "";
  }
  export interface ReqSave {
    id?: number;
    dcode: string;
    dvalue: string;
    showOrder?: string;
    remark?: string;
  }

  export interface ResSearch {
    key: string;
    value: ResGetByNames[];
  }

  export interface ResGetCatalogByType {
    id: number;
    systemCode: string;
    remark: string;
    status: number;
    flagSystem: number;
    douser: string;
    dotime: string;
    uptime: string;
    dcode: string;
    dtype: string;
  }

  export interface ResGetByNames {
    dcode: string;
    dotime: string;
    douser: string;
    dvalue: string;
    flagSystem: number;
    id: number;
    pid: number;
    remark: string;
    showOrder: number;
    status: number;
    uptime: string;
  }
}

// 物料信息
export namespace Material {
  //保存
  export interface ReqSave {
    id: number;
    mtype: string;
    mname: string;
    msize: string;
    munit: string;
    remark: string;
    douser?: string;
  }
  // 查询
  export interface ResSearch {
    records: SearchProp[];
  }
  export interface SearchProp extends so_ReqSaveSo {
    id: number;
    status: number;
    remark: string;
    douser: string;
    dotime: string;
    uptime: string;
    mtype: string;
    munit: string;
    mname: string;
    msize: string;
    mcode: string;
    materialSoObj: ReqSaveSo;
  }

  // 物料在分拣的补充信息
  interface so_ReqSaveSo {
    so_id?: number;
    so_materialId: number;
    so_dischargeAlong: string;
    so_soPackageType: string;
    so_soDoType: string;
    so_remark: string;
    so_douser: string;
  }

  export interface M_SearchProp {
    m_id: number;
    m_status: number;
    m_remark: string;
    m_douser: string;
    m_dotime: string;
    m_uptime: string;
    m_mtype: string;
    m_munit: string;
    m_mname: string;
    m_msize: string;
    m_mcode: string;
  }
  //使用范围查询
  export interface SearchScopeProp {
    dotime: string;
    douser: string;
    id: number;
    materialId: number;
    remark: string;
    uptime: string;
    useScope: string;
  }

  // 查询物料池 查询参数
  export interface ResSearchParams extends ReqPage {
    mtype: string;
    key: string;
    status: number | "";
    scope: string;
  }

  // 保存物料的使用范围
  export interface ReqSaveScope {
    id?: number;
    materialId: number;
    useScope: string;
    remark: string;
    douser: string;
  }
  // 保存物料在分拣的补充信息
  export interface ReqSaveSo {
    id?: number;
    materialId: number;
    dischargeAlong: string;
    soPackageType: string;
    soDoType: string;
    remark: string;
    douser: string;
  }

  // 查询物料在分拣的补充信息
  export interface ResSoSearch {
    id: number;
    materialId: number;
    dischargeAlong: string;
    soPackageType: string;
    soDoType: string;
    remark: string;
    douser: string;
    dotime: string;
    timeUnit?: string;
    uptime: string;
  }

  export interface M_resSoSearch {
    m_id: number;
    m_materialId: number;
    m_dischargeAlong: string;
    m_soPackageType: string;
    m_soDoType: string;
    m_remark: string;
    m_douser: string;
    m_dotime: string;
    m_timeUnit?: string;
    m_uptime: string;
  }
}

export namespace Customer {
  // 查询客户参数
  export interface ReqSearchParams extends ReqPage {
    ctype: string;
    key: string;
    status: number;
  }

  // 查询客户
  export interface ReqSearch {
    records: SearchProp[];
  }

  export interface c_SearchProp {
    c_id: number;
    c_status: number;
    c_remark: string;
    c_douser: string;
    c_dotime: string;
    c_uptime: string;
    c_cfullName: string;
    c_ctype: string;
    c_cindex: string;
    c_cname: string;
    c_ccode: string;
  }

  // 解构后的客户查询参数
  export interface SearchProp {
    id?: number;
    status: number;
    remark: string;
    douser: string;
    dotime: string;
    uptime: string;
    cfullName: string;
    ctype: string;
    cindex: string;
    cname: string;
    ccode: string;
  }
}
